<?php 
function set_res_OK(&$res, $console_log = null) {
    $res["result"] = "OK";
    if(isset($console_log)) {
        $res["console_log"] = $console_log;
    }
}

function set_res_NG(&$res, $console_log = null, $err_msg_display = null, $id_focus_in=null) {
    $res["result"] = "NG";
    if(isset($console_log)) {
        $res["console_log"] = $console_log;
    }
    if(isset($err_msg_display)) {
        $res["err_msg_display"] = $err_msg_display;
    }
    if(isset($id_focus_in)) {
        $res["err_focus_in_type"] = "not_grid";
        $res["id_focus_in"] = $id_focus_in;
    }
}

function set_res_grid_NG(&$res, $console_log = null, $err_msg_display = null, $err_grid_id = null, $err_row = null, $err_col_name = null) {
    $res["result"] = "NG";
    if(isset($console_log)) {
        $res["console_log"] = $console_log;
    }
    if(isset($err_msg_display)) {
        $res["err_msg_display"] = $err_msg_display;
    }
    if(isset($err_grid_id)) {
        $res["err_focus_in_type"] = "grid";
        $res["err_grid_id"] = $err_grid_id;
        if(isset($err_row)) $res["err_row"] = $err_row;
        if(isset($err_col_name)) $res["err_col_name"] = $err_col_name;
    }
}
?>